﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace Faser_Shop.Models.Database
{
    public partial class Product
    {
        public Product()
        {
            OrderDetails = new HashSet<OrderDetail>();
            ShoppingCarts = new HashSet<ShoppingCart>();
        }

        [Key]
        [Column("ProductID")]
        public int ProductId { get; set; }
        [StringLength(50)]
        public string ProductName { get; set; }
        public string ProductImage { get; set; }
        [Column(TypeName = "decimal(18, 2)")]
        public decimal? ProductPrice { get; set; }
        public int? ProductStock { get; set; }
        public string ProductDescription { get; set; }
        [Column("CategoryID")]
        public int? CategoryId { get; set; }
        public bool? OnSaleStatus { get; set; }

        [ForeignKey(nameof(CategoryId))]
        [InverseProperty(nameof(ProductCategory.Products))]
        public virtual ProductCategory Category { get; set; }
        [InverseProperty(nameof(OrderDetail.Product))]
        public virtual ICollection<OrderDetail> OrderDetails { get; set; }
        [InverseProperty(nameof(ShoppingCart.Product))]
        public virtual ICollection<ShoppingCart> ShoppingCarts { get; set; }
    }
}
